<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>利用函数反转数组元素顺序</title>
    <script>
       function reverse(arr){
           var newArr = [];
           for(var i = arr.length - 1;i >= 0;i--){
               newArr[newArr.length] = arr[i];
           }
           return newArr;
       }
       var arr1 = reverse([1,3,4,6,9]);
       console.log(arr1);

    </script>
</head>
<body>

</body>
</html>